package com.jintoufs.util;

import java.util.Random;

/**
 * 临时箱(非标)自动生成编号，以04开头
 *
 * Created by YangHao on 2016/6/29.
 */
public final class CashBoxCodeGenerator {

    public static String getRandNum() {
        int charCount=5;
        String charValue = "";
        for (int i = 0; i < charCount; i++) {
            char c = (char) (randomInt(0, 10) + '0');
            charValue += String.valueOf(c);
        }
        charValue="0"+charValue;
        return charValue;
    }

    public static int randomInt(int from, int to) {
        Random r = new Random();
        return from + r.nextInt(to - from);
    }
}
